package com.dime.physical.service.impl;

import java.util.List;
import com.ruoyi.common.core.utils.DateUtils;
import com.ruoyi.common.core.utils.uuid.IdUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.dime.physical.mapper.DimePhysicalitemsMapper;
import com.dime.physical.domain.DimePhysicalitems;
import com.dime.physical.service.IDimePhysicalitemsService;

/**
 * 人员项目Service业务层处理
 * 
 * @author Tiny
 * @date 2023-09-14
 */
@Service
public class DimePhysicalitemsServiceImpl implements IDimePhysicalitemsService 
{
    @Autowired
    private DimePhysicalitemsMapper dimePhysicalitemsMapper;

    /**
     * 查询人员项目
     * 
     * @param id 人员项目主键
     * @return 人员项目
     */
    @Override
    public DimePhysicalitems selectDimePhysicalitemsById(String id)
    {
        return dimePhysicalitemsMapper.selectDimePhysicalitemsById(id);
    }

    /**
     * 查询人员项目列表
     * 
     * @param dimePhysicalitems 人员项目
     * @return 人员项目
     */
    @Override
    public List<DimePhysicalitems> selectDimePhysicalitemsList(DimePhysicalitems dimePhysicalitems)
    {
        return dimePhysicalitemsMapper.selectDimePhysicalitemsList(dimePhysicalitems);
    }

    /**
     * 新增人员项目
     * 
     * @param dimePhysicalitems 人员项目
     * @return 结果
     */
    @Override
    public int insertDimePhysicalitems(DimePhysicalitems dimePhysicalitems)
    {
        dimePhysicalitems.setId(IdUtils.fastUUID());
        dimePhysicalitems.setCreateBy(SecurityUtils.getUsername());
        dimePhysicalitems.setCreateTime(DateUtils.getNowDate());
        return dimePhysicalitemsMapper.insertDimePhysicalitems(dimePhysicalitems);
    }

    /**
     * 修改人员项目
     * 
     * @param dimePhysicalitems 人员项目
     * @return 结果
     */
    @Override
    public int updateDimePhysicalitems(DimePhysicalitems dimePhysicalitems)
    {
        dimePhysicalitems.setUpdateTime(DateUtils.getNowDate());
        dimePhysicalitems.setUpdateBy(SecurityUtils.getUsername());
        return dimePhysicalitemsMapper.updateDimePhysicalitems(dimePhysicalitems);
    }

    /**
     * 批量删除人员项目
     * 
     * @param ids 需要删除的人员项目主键
     * @return 结果
     */
    @Override
    public int deleteDimePhysicalitemsByIds(String[] ids)
    {
        return dimePhysicalitemsMapper.deleteDimePhysicalitemsByIds(ids);
    }

    /**
     * 删除人员项目信息
     * 
     * @param id 人员项目主键
     * @return 结果
     */
    @Override
    public int deleteDimePhysicalitemsById(String id)
    {
        return dimePhysicalitemsMapper.deleteDimePhysicalitemsById(id);
    }
}
